#-*-coding:utf-8-*-
from django.contrib import admin
import xadmin
from xadmin import views


from models import *
# Register your models here.


class ServerAdmin(object):
    list_display = ['id', 'name', 'memory', 'get_cpu', 'get_kernels', 'get_disks', 'get_vlan_ip', 'get_wan_ip']


class CpuAdmin(object):
    list_display = ['id', 'name', 'kernel', 'frequency']


class DiskAdmin(object):
    list_display = ['id', 'name', 'mount_path', 'size']


class GeneratorRoomAdmin(object):
    list_display = ['id', 'name', 'address', 'phone_num', 'get_servers']


class IpAddressAdmin(object):
    list_display = ['id', 'ip', 'type', 'get_server']


xadmin.site.register(Server, ServerAdmin)
xadmin.site.register(Cpu, CpuAdmin)
xadmin.site.register(Disk, DiskAdmin)
xadmin.site.register(GeneratorRoom, GeneratorRoomAdmin)
xadmin.site.register(IpAddress, IpAddressAdmin)